﻿/**********************************************************
 Name：MatrixRoleRightRelation
 Author：
 Date：2012-12-31 11:09:22
 Description：
**********************************************************/
using System;
using PetaPoco;

namespace WebAppMatrix.Entity.Security
{
    /// <summary>
    /// This Entity is Mapping To [MatrixRoleRightRelation] Table
    /// Remark Ignore Attribute for the field when it is not need mapping
    /// </summary>
    [Serializable]
    [TableName("MatrixRoleRightRelation")]
    [PrimaryKey("RelationID", autoIncrement = false)]
    public class MatrixRoleRightRelation
    {
        /// <summary>
        /// RelationID
        /// </summary>
        public string RelationID
        {
            get;
            set;
        }

        /// <summary>
        /// RoleID
        /// </summary>
        public string RoleID
        {
            get;
            set;
        }

        /// <summary>
        /// RightID
        /// </summary>
        public string RightID
        {
            get;
            set;
        }

        /// <summary>
        /// ModuleID
        /// </summary>
        public string ModuleID
        {
            get;
            set;
        }

        /// <summary>
        /// Equals
        /// </summary>
        public override bool Equals(object obj)
        {
            MatrixRoleRightRelation other = obj as MatrixRoleRightRelation;
            if (other == null || string.IsNullOrEmpty(this.RelationID) || string.IsNullOrEmpty(other.RelationID))
            {
                return false;
            }
            if (this.RelationID != other.RelationID)
            {
                return false;
            }
            return true;
        }
        /// <summary>
        /// GetHashCode
        /// </summary>
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}
